package so.sao.code.service.infrastructure.enums;

import so.sao.top.core.util.enums.NamedEnumEntity;

public enum PrintFileStatus implements NamedEnumEntity<Integer> {
	TODO(1, "待生成"), ING(2, "生成中"), COMPLETE(3, "已生成"), DOWNLOADED(4, "已下载");

	private Integer id;
	private String name;

	private PrintFileStatus(Integer id, String name) {
		this.id = id;
		this.name = name;
	}

	@Override
	public Integer getValue() {
		return id;
	}

	@Override
	public String getName() {
		return name;
	}

	public static PrintFileStatus fromValue(Integer id) {
		switch (id) {
		case 1:
			return TODO;
		case 2:
			return ING;
		case 3:
			return COMPLETE;
		case 4:
			return DOWNLOADED;
		default:
			throw new IllegalArgumentException("Value [" + id + "] not support!");
		}
	}
}
